package com.dwa.persistent.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.dwa.domain.News;
import com.dwa.domain.INews;

public class NewsMapper implements RowMapper 
{
	public Object mapRow(ResultSet rs, int rowNum) throws SQLException 
	{
		INews news  = new News();
		news.setId(rs.getLong("id"));
		news.setTitle(rs.getString("title"));
		news.setDescription(rs.getString("description"));
		news.setCreatedOn(rs.getDate("created_on"));
		news.setNewsDate(rs.getDate("news_date"));
		return news;
	}
}